package adv41;

/**
 * @author oldliu
 * @since 1.0
 */
public class MyThread2 implements Runnable {
    private String name;
    public MyThread2(String n){
        this.name=n;
    }
    @Override
    public void run() {
        for (int i =1; i <=20 ; i++) {
            System.out.println(this.name+" print "+i);
            //System.out.println(Thread.currentThread().getName()+" print "+i);
        }
    }
    public static void main(String[] args) {
        for (int i = 1; i <=5 ; i++) {
            MyThread2 n=new MyThread2("线程"+i);
            new Thread(n).start();
        }
    }
}
